.class public abstract Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;
.super Ljava/lang/Object;
.source "AbstractAdaptorFactory.java"

# interfaces
.implements Lcom/burstly/lib/feature/networks/IAdaptorFactory;


# static fields
.field protected static final CONTEXT:Ljava/lang/String; = "context"

.field private static final LOG:Lcom/burstly/lib/util/LoggerExt; = null

.field private static final TAG:Ljava/lang/String; = null

.field protected static final VIEW_ID:Ljava/lang/String; = "viewId"


# instance fields
.field private final mFactoryName:Ljava/lang/String;

.field private final mUsedSdkClassName:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 39
    const-class v0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->TAG:Ljava/lang/String;

    .line 44
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->LOG:Lcom/burstly/lib/util/LoggerExt;

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;)V
    .locals 0
    .parameter "usedSdkClassName"
    .parameter "factoryName"

    .prologue
    .line 72
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 73
    iput-object p1, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mUsedSdkClassName:Ljava/lang/String;

    .line 74
    iput-object p2, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mFactoryName:Ljava/lang/String;

    .line 75
    return-void
.end method

.method private checkParameters(Ljava/lang/Object;Ljava/lang/Object;)Z
    .locals 6
    .parameter "viewId"
    .parameter "context"

    .prologue
    const/4 v1, 0x1

    const/4 v0, 0x0

    .line 107
    if-nez p1, :cond_0

    .line 108
    sget-object v2, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->TAG:Ljava/lang/String;

    const-string v4, "viewId can not be null in factory {0}"

    new-array v1, v1, [Ljava/lang/Object;

    iget-object v5, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mFactoryName:Ljava/lang/String;

    aput-object v5, v1, v0

    invoke-virtual {v2, v3, v4, v1}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 121
    :goto_0
    return v0

    .line 110
    :cond_0
    if-nez p2, :cond_1

    .line 111
    sget-object v2, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->TAG:Ljava/lang/String;

    const-string v4, "context can not be null in factory {0}"

    new-array v1, v1, [Ljava/lang/Object;

    iget-object v5, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mFactoryName:Ljava/lang/String;

    aput-object v5, v1, v0

    invoke-virtual {v2, v3, v4, v1}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 114
    :cond_1
    instance-of v2, p1, Ljava/lang/String;

    if-nez v2, :cond_2

    .line 115
    sget-object v2, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->TAG:Ljava/lang/String;

    const-string v4, "viewId must be a string in factory {0}"

    new-array v1, v1, [Ljava/lang/Object;

    iget-object v5, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mFactoryName:Ljava/lang/String;

    aput-object v5, v1, v0

    invoke-virtual {v2, v3, v4, v1}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 117
    :cond_2
    instance-of v2, p2, Landroid/content/Context;

    if-nez v2, :cond_3

    .line 118
    sget-object v2, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v3, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->TAG:Ljava/lang/String;

    const-string v4, "context must be a Context instance in factory {0}"

    new-array v1, v1, [Ljava/lang/Object;

    iget-object v5, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mFactoryName:Ljava/lang/String;

    aput-object v5, v1, v0

    invoke-virtual {v2, v3, v4, v1}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    :cond_3
    move v0, v1

    .line 121
    goto :goto_0
.end method


# virtual methods
.method public createAdaptor(Ljava/util/Map;)Lcom/burstly/lib/component/IBurstlyAdaptor;
    .locals 4
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "*>;)",
            "Lcom/burstly/lib/component/IBurstlyAdaptor;"
        }
    .end annotation

    .prologue
    .local p1, createParams:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;*>;"
    const/4 v2, 0x0

    .line 79
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->isSdkAvailable()Z

    move-result v3

    if-nez v3, :cond_1

    .line 87
    :cond_0
    :goto_0
    return-object v2

    .line 82
    :cond_1
    const-string v3, "viewId"

    invoke-interface {p1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    .line 83
    .local v1, viewId:Ljava/lang/Object;
    const-string v3, "context"

    invoke-interface {p1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    .line 84
    .local v0, context:Ljava/lang/Object;
    invoke-direct {p0, v1, v0}, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->checkParameters(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 85
    check-cast v0, Landroid/content/Context;

    .end local v0           #context:Ljava/lang/Object;
    check-cast v1, Ljava/lang/String;

    .end local v1           #viewId:Ljava/lang/Object;
    invoke-virtual {p0, v0, v1}, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->createInstance(Landroid/content/Context;Ljava/lang/String;)Lcom/burstly/lib/component/IBurstlyAdaptor;

    move-result-object v2

    goto :goto_0
.end method

.method protected abstract createInstance(Landroid/content/Context;Ljava/lang/String;)Lcom/burstly/lib/component/IBurstlyAdaptor;
.end method

.method public destroy()V
    .locals 0

    .prologue
    .line 148
    return-void
.end method

.method public initialize(Ljava/util/Map;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "*>;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalArgumentException;
        }
    .end annotation

    .prologue
    .line 152
    .local p1, initParams:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;*>;"
    return-void
.end method

.method protected isSdkAvailable()Z
    .locals 2

    .prologue
    .line 96
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mUsedSdkClassName:Ljava/lang/String;

    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mFactoryName:Ljava/lang/String;

    invoke-static {v0, v1}, Lcom/burstly/lib/util/Utils;->isSdkAvailable(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public toString()Ljava/lang/String;
    .locals 1

    .prologue
    .line 135
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/AbstractAdaptorFactory;->mFactoryName:Ljava/lang/String;

    return-object v0
.end method

.method public abstract validateManifest()Lcom/burstly/lib/util/ManifestValidator$ValidationResults;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/content/pm/PackageManager$NameNotFoundException;
        }
    .end annotation
.end method
